<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<f:view>
	<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">
		<ui:define name="content">
			<h:inputHidden rendered="#{menuController.userRank != 1}" value="#{menuController.redirect()}"></h:inputHidden>
			<h:inputHidden value="#{menuController.setUrl(request.requestURL)}"></h:inputHidden>
			<h:inputHidden rendered="#{menuController.userRank == 1}">
			<!--  TO DO: css and validators. Don't forget to make bottom border for cells! -->
			<h:panelGrid columns="2">
				<h:outputText value="Test name"></h:outputText>
				<h:outputText value="#{testDetailsBean.testName}"></h:outputText>
				<h:outputText value="Candidate name"></h:outputText>
				<h:outputText value="#{testDetailsBean.candidateName}"></h:outputText>
				<h:outputText value="Date"></h:outputText>
				<h:outputText value="#{testDetailsBean.date}"></h:outputText>
				<h:outputText value="Room"></h:outputText>
				<h:outputText value="#{testDetailsBean.room}"></h:outputText>
				<h:outputText value="Correct"></h:outputText>
				<h:outputText value="#{testDetailsBean.score}%"></h:outputText>

			</h:panelGrid>
			<br />
			<h:dataTable value="#{testDetailsBean.entrySet}" var="keys"
				border="0">
				<h:column>
					<f:facet name="header">
    				Category
				</f:facet>
					<h:dataTable value="#{keys}" var="type" styleClass="inner-table">
						<h:column>
							<h:outputText value="#{type.key}" />
						</h:column>
					</h:dataTable>
				</h:column>

				<h:column>
					<f:facet name="header">
    				Percent
				</f:facet>
					<h:dataTable value="#{keys}" var="type" styleClass="inner-table">
						<h:column>
							<h:outputText value="#{type.value.get(3)}%">
								<f:convertNumber pattern="#,###,##0.00" />
							</h:outputText>
						</h:column>
					</h:dataTable>
				</h:column>

				<h:column>
					<f:facet name="header">
    				Points
				</f:facet>
					<h:dataTable value="#{keys}" var="type" styleClass="inner-table">
						<h:column>
							<h:outputText value="#{type.value.get(0)}" />
						</h:column>
					</h:dataTable>
				</h:column>

				<h:column>
					<f:facet name="header">
    				From
				</f:facet>
					<h:dataTable value="#{keys}" var="type" styleClass="inner-table">
						<h:column>
							<h:outputText value="#{type.value.get(1)}" />
						</h:column>
					</h:dataTable>
				</h:column>

				<h:column>
					<f:facet name="header">
    				Correct
				</f:facet>
					<h:dataTable value="#{keys}" var="type" styleClass="inner-table">
						<h:column>
							<h:outputText value="#{type.value.get(2)}%">
								<f:convertNumber pattern="#,###,##0.00" />
							</h:outputText>
						</h:column>
					</h:dataTable>
				</h:column>
			</h:dataTable>
			<br />

			<h:form>
				<h:commandButton value="Cancel" styleClass="button" action="testerhome.xhtml"></h:commandButton>
			</h:form>
			</h:inputHidden>
		</ui:define>
	</ui:composition>
</f:view>
</html>